
#include "functions.h"

Obj *
f_progn( void * tag, List * args )
{
    RuleEngineContext * r = tag;
    Obj *               ret = g_nil_obj;

    if( args && args->car )
    {
        do
        {
            ret = internal_evaluate( r->eval, args->car );

            args = args->cdr;
        }
        while( 0 != args );
    }

    return ret;
}


Obj *
f_print( void * tag, List * args )
{
    FILE *      fout = stderr;

    if( args )
    {
        print_obj( (Obj *)args, fout );
        fputc( '\n', fout );
    }

    return g_nil_obj;
}

Obj *
f_quit( void * tag, List * args )
{
    RuleEngineContext * r = tag;
    evaluator_emit_error( r->eval, QL_ERR_STOP );
    return 0;
}
